home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 47
/
Amiga Format AFCD47 (Issue 131, Xmas 1999).iso
/
-serious-
/
misc
/
fiasco_2.22
/
arexx
/
dummy.frx
< prev
next >
Wrap
Text File
|
1999-10-17
|
3KB
|
166 lines
/* dummy.frx
* Skeleton script that can be used as base for ARexx scripts
* Copyright © 1997-1999 Nils Bandener
* $VER: dummy_frx 6.11 (26.6.99)
*
* Changes:
* 6.11 (26.06.99) - Error interpretation for FAILURE-errors was not correct
* 6.10 (20.10.98) - No longer tries to access FIASCO.HELP.1 or such ports
*/
/* Please specify here a name for the ARexx script:
*/
scriptname = "Dummy Script"
Options Results
/*
* If not called from Fiasco, try to address the active
* Fiasco project
*/
if ~abbrev(address(), "FIASCO.") then
do
/* Get list of all available ports */
ports = show("Ports")
/* Search for a port of Fiasco */
do i = 1 to words(ports)
portname = word(ports, i)
if abbrev(portname, "FIASCO.") then
do
if datatype(substr(portname, 8), "Numeric") then
do
/* A port of Fiasco has been found.
* Now query Fiasco to return the port
* name of the active database.
*/
Address Value portname
GetAttr Project Name Active ARexx Var p
/* Workaround for bug in Fiasco 2.21:
* When GetAttr is called immediately after
* Fiasco has been started, the result
* may be incorrect:
*/
if rc == 0 & length(p) == 0 then
do
p = portname
end
/* This command may fail when
* no projects are active. This is
* for example the case, when all
* projects are hidden.
*/
if rc == 0 then
do
Address Value p
end
else
do
RequestChoice '"No active project" "Cancel" Title "' || scriptname || '"'
call bail_out
end
break
end
end
end
end
fiasco_port = address()
Signal on Syntax
Signal on Halt
Signal on Break_C
Signal on Failure
/* This script runs while the user cannot do anything
* in Fiasco's GUI
*/
LockGUI
/* Code of own scripts must be inserted here.
* To exit the script, you may directly fall through to bail_out
* or call it directly.
* IMPORTANT: Be sure that bail_out is executed! Otherwise,
* the user will be locked out of Fiasco.
*/
bail_out:
Address Value fiasco_port
UnlockGUI
ResetStatus
exit
syntax:
if show("Ports", fiasco_port) then
do
Address Value fiasco_port
RequestChoice '"Error ' || rc || ' in line ' || sigl || ':*n' || errortext(rc) || '" "Cancel" Title "' || scriptname || '"'
end
else
do
say "Error" rc "in line" sigl ":" errortext(rc)
say "Enter to continue"
pull dummy
end
call bail_out
failure:
if show("Ports", fiasco_port) then
do
Address Value fiasco_port
RequestChoice '"Command in line ' || sigl || '*nreturned error code ' || rc || '" "Cancel" Title "' || scriptname || '"'
end
else
do
say "Command in line" sigl "returned error code" rc
say "Enter to continue"
pull dummy
end
call bail_out
halt:
break_c:
if show("Ports", fiasco_port) then
do
Address Value fiasco_port
RequestChoice '"Script Abort Requested" "Abort Script" Title "' || scriptname || '"'
end
else
do
say "*** Break"
say "Enter to continue"
pull dummy
end
call bail_out